package com.zhongshan.ga.mobile.resource;

import org.restlet.representation.Representation;
import org.restlet.representation.StringRepresentation;
import org.restlet.resource.Get;
import org.restlet.resource.Post;
import org.restlet.resource.ServerResource;

import com.google.gson.JsonObject;
import com.zhongshan.ga.logger.GenerateLog;
import com.zhongshan.ga.mobile.logic.GetTravelMateListLogic;

/**
 * 获取结伴游列表服务接口
 * @author yanqi
 *
 */
public class GetTravelMateListResource extends ServerResource {
	@Get
	public Representation getTravelMateList(Representation entity) {
		GenerateLog.outDebug("调用了获得结伴游列表的方法");
		entity = post(entity);
		return entity;
	}
	
	@Post
	public Representation postTravelMateList(Representation entity) {
		GenerateLog.outDebug("调用了获得结伴游列表的方法");
		GetTravelMateListLogic getTravelMateListLogic = new GetTravelMateListLogic();
		JsonObject resultJsonObject = getTravelMateListLogic.getTravelMateList(entity);
		Representation representation = new StringRepresentation(resultJsonObject.toString());
		return representation;
	}
}
